class HorsesexesController < ApplicationController
  # GET /horsesexes
  # GET /horsesexes.xml
  def index
    @horsesexes = Horsesexe.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @horsesexes }
    end
  end

  # GET /horsesexes/1
  # GET /horsesexes/1.xml
  def show
    @horsesexe = Horsesexe.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @horsesexe }
    end
  end

  # GET /horsesexes/new
  # GET /horsesexes/new.xml
  def new
    @horsesexe = Horsesexe.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @horsesexe }
    end
  end

  # GET /horsesexes/1/edit
  def edit
    @horsesexe = Horsesexe.find(params[:id])
  end

  # POST /horsesexes
  # POST /horsesexes.xml
  def create
    @horsesexe = Horsesexe.new(params[:horsesexe])

    respond_to do |format|
      if @horsesexe.save
        flash[:notice] = 'Horsesexe was successfully created.'
        format.html { redirect_to(@horsesexe) }
        format.xml  { render :xml => @horsesexe, :status => :created, :location => @horsesexe }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @horsesexe.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /horsesexes/1
  # PUT /horsesexes/1.xml
  def update
    @horsesexe = Horsesexe.find(params[:id])

    respond_to do |format|
      if @horsesexe.update_attributes(params[:horsesexe])
        flash[:notice] = 'Horsesexe was successfully updated.'
        format.html { redirect_to(@horsesexe) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @horsesexe.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /horsesexes/1
  # DELETE /horsesexes/1.xml
  def destroy
    @horsesexe = Horsesexe.find(params[:id])
    @horsesexe.destroy

    respond_to do |format|
      format.html { redirect_to(horsesexes_url) }
      format.xml  { head :ok }
    end
  end
end
